<?php

/**
 * Created by PhpStorm.
 * User: edmmss
 * Date: 2021/9/28
 * Time: 11:01
 */

namespace Edmmss\Easyswoole\Task\Traits;

trait Singleton
{
    private static $instance;

    /**
     * 获取实例
     *
     * @date   2021/9/28
     * @param ...$args
     * @return mixed
     * @author edmmss
     */
    static function getInstance(...$args)
    {
        if(!isset(static::$instance)){
            static::$instance = new static(...$args);
        }
        return static::$instance;
    }
}